import java.awt.event.KeyEvent;
import java.awt.image.BufferedImage;
import java.util.LinkedList;


// Project: 

/******************************************************************************
 * <p>
 * File: mapTile.java
 * </p>
 * @author  Tadhg O'Sullivan, rogue
 * @author <a href="mailto:tadhg.osullivan@ucdconnect.ie">tadhg.osullivan@ucdconnect.ie</a>
 * @version 1.0, 2007
 * @created 2-Mar-07 4:56:50 PM
 * @revised 
 * Copyright 2007 Tadhg O'Sullivan
 * <p>
 * Description: Create a tileObject which is a tile for the map
 * </p>
 *  <p>
 *  This file is part of Retribution.
 *  </p>
 *  <p>
 *  Retribution is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  Retribution is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with Retribution; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *  <p>
 *****************************************************************************/

public class mapTile extends tileObject{

	protected boolean collisionState; // set to true if causes collision
	protected boolean goal; // set to true if this is a goal tile
	public boolean escapePressed = false;
	LinkedList<mapTile> ll;
	public int houseNumber;
	
	/**
	 * @param i The BufferedImage for the tile
	 * @param n The number used to reference the tile
	 * @param x The x coordinate of the tile
	 * @param y The y coordinate of the tile
	 * @param c A boolean defining whether object causes collision
	 * @param g A boolean defining whether object is a goal
	 */
	public mapTile(BufferedImage i, int n, int x, int y, boolean c, boolean g, int house) {
		super(i, n, x, y);
		this.collisionState = c;
		this.goal = g;
		this.houseNumber = house;
	}

	/**
	 * @return collisionState A boolean defining whether tile causes a collsion
	 */
	public boolean getCollisionState(){
		return collisionState;
	}
	
	/**
	 * @return goal A boolean defining whether tile is a goal
	 */
	public boolean getGoal(){
		return goal;
	}
	
	
	/**
	 * @param c The collisionState boolean for the tile
	 */
	public void setCollisionState(boolean c){
		this.collisionState = c;
	}
	
	/**
	 * @param g The goal boolean for the tile
	 */
	public void setGoal(boolean g){
		this.goal = g;
	}
	
	public void setHouse(int house){
		this.houseNumber = house;
	}
	
	public int getHouse(){
		return houseNumber;
	}
	
//	 key events
	 public void keyTyped(KeyEvent e) {
		   	switch (e.getKeyCode()) {
		  		case KeyEvent.VK_ESCAPE : escapePressed = true;
		  		System.out.println("ESCAPE");
		  		break;
		   	}
		  }
}
